package cn.tedu.supermarket.mapper;

import cn.tedu.supermarket.entity.BannersDTO;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface BannersMapper {
    @Insert("insert into banners values(null,#{imgurl})")
    Integer insert(String imgurl);

    @Select("select id,imgurl from banners")
    List<BannersDTO> select();
    @Select("select imgurl from banners where id=#{id}")
    String selectById(int id);

    @Delete("delete from banners where id=#{id}")
    Integer delete(int id);
}
